package com.jxj.test.controller;

import com.jxj.entity.Resp;
import com.jxj.entity.gen.TUser;
import com.jxj.util.JWTUtil;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Cambria
 * @creat 2021/8/14 20:38
 */
@RestController
public class TokenController {

    @PostMapping
    Resp<String> signUser(TUser user , int orgId) {
        String sign = JWTUtil.sign(user);
        System.out.println(sign);
        //return ResponseEntity.status(HttpStatus.OK).body(sign);
        return new Resp<>(HttpStatus.CREATED , sign);
    }

}
